package src.四则运算;
import java.util.Scanner;
public class TestLevel {
    public static void main(String[] args) {

            int n;//题目等级
            int i=0;//题目数量
            String another = "y";
            String result;//计算结果
            Scanner scan1 = new Scanner(System.in);
            Scanner scan2 = new Scanner(System.in);
            Scanner scan3 = new Scanner(System.in);

            while (another.equalsIgnoreCase("y")) {
               ;QuestionGenerator lv=new QuestionGenerator();

                System.out.println("请输入题目等级：");
                n = scan1.nextInt();
                if (n == 1) {
                    System.out.println(lv.getQuestion(1) + "=");
                    result = scan2.nextLine();
                    i++;
                }
                else if (n == 2) {
                    System.out.println(lv.getQuestion(2) + "=");
                    result = scan2.nextLine();
                    i++;
                }
                else if (n == 3) {
                    System.out.println(lv.getQuestion(3) + "=");
                    result = scan2.nextLine();
                    i++;
                }
                else if (n == 4) {
                    System.out.println(lv.getQuestion(4) + "=");
                    result = scan2.nextLine();
                    i++;
                }
                else if (n == 5) {
                    System.out.println(lv.getQuestion(5) + "=");
                    result= scan2.nextLine();
                    i++;
                }
                else
                    System.out.println(lv.getQuestion(0));

                System.out.println("是否继续（y/n）：");
                another = scan3.nextLine();
                }
            System.out.println("共做了"+i+"道题");
        }
    }

